Skip to content

Conversation

@tenphi
Copy link
Member

@tenphi tenphi commented Jul 15, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Jul 15, 2025

🦋 Changeset detected

Latest commit: c07963d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tenphi tenphi requested a review from Copilot July 15, 2025 17:23
@vercel
Copy link

vercel bot commented Jul 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cube-ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 3:52pm
cube-ui-kit-cursor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 3:52pm

@github-actions
Copy link
Contributor

github-actions bot commented Jul 15, 2025

📦 NPM canary release

Deployed canary version 0.0.0-canary-6ea7a04.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 15, 2025

🏋️ Size limit report

Name Size Passed?
All 262.27 KB (+0.3% 🔺) Yes 🎉
Tree shaking (just a Button) 21.71 KB (0% 🟰) Yes 🎉
Tree shaking (just an Icon) 11.4 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

@github-actions
Copy link
Contributor

github-actions bot commented Jul 15, 2025

🧪 Storybook is successfully deployed!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds useAnchoredMenu hook functionality to provide menu anchoring capabilities for the UI component library. The implementation includes event bus-based menu synchronization to ensure only one menu can be open at a time across different components.

  • Creates a comprehensive event bus system for global menu synchronization
  • Implements useAnchoredMenu hook for anchoring menus to specific elements
  • Adds useContextMenu hook for context menus at pointer coordinates

Reviewed Changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/utils/react/useEventBus.ts Implements event bus system with provider, hooks, and listener management
src/utils/react/sharedStore.ts Adds shared store functionality for state management across hot reloads
src/components/actions/use-anchored-menu.tsx Main useAnchoredMenu hook implementation with menu synchronization
src/components/actions/use-context-menu.tsx Context menu hook with coordinate-based positioning
src/components/actions/Menu/MenuTrigger.tsx Updates MenuTrigger to support event bus synchronization
src/components/fields/Select/Select.tsx Integrates Select component with menu synchronization
src/components/fields/ComboBox/ComboBox.tsx Integrates ComboBox component with menu synchronization
src/provider.tsx Adds EventBusProvider to component provider chain
src/components/Root.tsx Integrates EventBusProvider into Root component
Comments suppressed due to low confidence (1)

src/components/actions/Menu/Menu.test.tsx:1055

  • The useAnchoredMenu tests are comprehensive but missing error handling tests for the setup check functionality.
describe('useAnchoredMenu', () => {

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Nested Providers Cause Event Bus Context Isolation

The Root component creates nested EventBusProvider instances. This occurs because Root directly wraps its children with EventBusProvider, and it also renders the Provider component, which similarly wraps its children with EventBusProvider. This duplication leads to separate event bus contexts, breaking menu synchronization as events are isolated to the innermost provider.

src/provider.tsx#L50-L52

// Wrap with EventBusProvider for menu synchronization
children = <EventBusProvider>{children}</EventBusProvider>;

src/components/Root.tsx#L153-L158

<PortalProvider value={ref}>
<EventBusProvider>
<NotificationsProvider rootRef={ref}>
<AlertDialogApiProvider>{children}</AlertDialogApiProvider>
</NotificationsProvider>
</EventBusProvider>

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants